package com.april.pattern.behavioral.memento;

import java.util.Stack;

/**
 * @author April
 * @version V1.0.0
 * @date 2019/07/09 11:54
 * @description 备忘录的管理者
 */
public class ArticleMementoManager {
    private final Stack<ArticleMemento> ARTICLE_MEMENTO_STACK = new Stack<>();

    public ArticleMemento getMemento() {
        return ARTICLE_MEMENTO_STACK.pop();
    }

    public void addMemento(ArticleMemento articleMemento) {
        ARTICLE_MEMENTO_STACK.push(articleMemento);
    }

}
